//
//  CustomerSDKLoggerFormatter.m
//  SDKUI
//
//  Created by aiquantong on 16/08/2017.
//  Copyright © 2017 aiquantong. All rights reserved.
//

#import "CustomerSDKLoggerFormatter.h"

@implementation CustomerSDKLoggerFormatter

-(NSString*) formattedLogStringWithDate:(NSDate*)date
                              andThread:(NSString*)thread
                               andLevel:(EKandyLogLevel)level
                                andFile:(NSString*)file
                                andLine:(int)line
                              andMethod:(NSString*)method
                           andLogString:(NSString*)logString;
{
    NSDateFormatter *dateFormatter = [[NSDateFormatter alloc] init];
    [dateFormatter setDateFormat:@"yyyy-MM-dd HH:mm:ss"];
    NSString *currentDateStr = [dateFormatter stringFromDate:date];
    
    return [NSString stringWithFormat:@"[date:%@]-[thread:%@]-[level:%d]-[mm:%@]-[line:%d]-[fun:%@]-%@",currentDateStr,thread,(int)level,file,line,method,logString];
}

@end
